package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@NoArgsConstructor@AllArgsConstructor
@Setter@Getter
public class Attendance {
    //默认情况下状态为在值
    public static  final int STATE_NORMAL=0;
    //锁定状态即不在职
    public static  final int STATE_LOCK=1;

    private Long id;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date currentDate;

    private Employee employee;

    private Department department;

    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss",timezone = "GMT+8")
    private Date beginTime;

    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss",timezone = "GMT+8")
    private Date endTime;
    //默认设置为在职状态
    private int state = STATE_NORMAL;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

}